package com.edu.v2.compile.parser;

import com.edu.compile.Parser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @author yanzhao
 * @date 2021/10/23 14:07
 * @since 1.0.0
 */
@Component
public class IntParser implements Parser<String, Integer> {

    @Override
    public Integer parse(String value) {
        if (value == null) {
            return null;
        }
        if (StringUtils.isEmpty(value)) {
            return null;
        }
        return Integer.valueOf(value);
    }
}
